import axi from 'axios';

export default {
  getJobsInfoNotLoginApi(p) {
    return axi.get('/auth/queryBJobsByOptionsWoAu', {
      params: p,
    });
  },
  getJobsInfoLoginApi(p) {
    return axi.get('/bjob/queryBJobsByDirection', {
      params: p,
      headers: {
        Authorization: `Bearer ${sessionStorage.getItem('userToken')}`,
      },
    });
  },
  getDirectionApi(p) {
    return axi.get('/bdirection/queryBDirectionByUserId', {
      params: p,
      headers: {
        Authorization: `Bearer ${sessionStorage.getItem('userToken')}`,
      },
    });
  },
  getCityApi() {
    return axi.get('/ecity/queryECitys', {
      headers: {
        Authorization: `Bearer ${sessionStorage.getItem('userToken')}`,
      },
    });
  },
  getAllTypeApi() {
    return axi.get('/auth/queryEJobTypesWoAu', {
    });
  },
  getCandidateDetailApi(p) {
    return axi.get('/bcandidate/getInfo', {
      params: p,
      headers: {
        Authorization: `Bearer ${sessionStorage.getItem('userToken')}`,
      },
    });
  },
  changeFindJobStatusApi(p) {
    return axi.get('/bcandidate/changeFindJobStatus', {
      params: p,
      headers: {
        Authorization: `Bearer ${sessionStorage.getItem('userToken')}`,
      },
    });
  },
  addDeliveryApi(p) {
    return axi.post('/bdelivery/addBDelivery', p, {
      headers: {
        Authorization: `Bearer ${sessionStorage.getItem('userToken')}`,
      },
    });
  },
  uploadPic(p) {
    return axi.post('/auth/uploadPic', p, {
      headers: {
        Authorization: `Bearer ${sessionStorage.getItem('userToken')}`,
        'Content-Type': 'multipart/form-data',
      },
    });
  },
  update(id, p) {
    return axi.put(`/bcompany/update/${id}`, p, {
      headers: {
        Authorization: `Bearer ${sessionStorage.getItem('userToken')}`,
      },
    });
  },
};
